﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo7
{
    // Animal 派生类  子类
    // 定义    访问修饰符  class 子类  :  父类
    public class Dog:Animal
    {
        // 子类有特殊方法
        public void Bark()
        {
            Console.WriteLine("狗在吠");
        }

        // 子类的构造方法
        public Dog(double length,double weight)
        {
            base.Length = length;
            base.Weight = Weight;
            Console.WriteLine($"这是一只狗,体长{length}米，体重{weight}千克。");
        }
    }
}
